export default function MapLoader () {
    return new Promise((resolve, reject) => {
      if (window.AMap) {
        resolve(window.AMap)
      } else {
        var url = 'https://webapi.amap.com/maps?v=2.0&key=bcd9e57b32a9335b70c88e6b5f6b2ae1&callback=onLoad'
        var script = document.createElement('script')
        script.charset = 'utf-8'
        script.src = url
        script.onerror = reject
        document.head.appendChild(script)
      }
      window.onLoad = () => {
        resolve(window.AMap)
      }
    })
  }